package lk.icta.common.dao;

import lk.icta.common.entity.DSDivision;
import lk.icta.common.entity.District;
import lk.icta.user.entity.User;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Supun Nimesh Karunathilaka
 * @author Tharanga Punchihewa
 */
public interface DSDivisionDAO {
    /**
     * Add a new DS Division
     *
     * @param dsDivision division to be marked
     * @param user       user executing the operation
     */
    public void addDSDivision(DSDivision dsDivision, User user);

    /**
     * Update a DS Division
     *
     * @param dsDivision division to be updated
     * @param user       user executing the operation
     */
    public void updateDSDivision(DSDivision dsDivision, User user);

    /**
     * Returns the list of DSDivisions for the given language
     *
     * @param districtId the District ID
     * @param language   the language ID (see AppConstants)
     * @param user       the user requesting the Division name list
     * @return a Map of known D.S. Divisions for the given language along with the ID
     */
    public Map<Integer, String> getDSDivisionNamesByDistrictId(int districtId, String language, User user);

    /**
     * Returns the list of DSDivisions for the given language
     *
     * @param districtId the District ID
     * @param language   the language ID (see AppConstants)
     * @return a Map of known D.S. Divisions for the given language along with the ID
     */
    public Map<Integer, String> getDSDivisionNamesByDistrictId(int districtId, String language);


    /**
     * Return DSDivision by id
     *
     * @param dsDivisionUKey the unique internal ID (PK)
     * @return the DSDivision
     */
    public DSDivision getDSDivisionByPK(int dsDivisionUKey);

    public Set<DSDivision> getDSDivisionListByProvinceId(int provinceId);

    /**
     * Return all DS Divisions
     *
     * @return all DS Divisions
     */
    public List<DSDivision> findAll();

    /**
     * @param dsDivisionId the unique DS Division ID
     * @param district     District of the  DS Division
     * @return the list of DS divisions
     */
    public List<DSDivision> getDSDivisionByCode(int dsDivisionId, District district);

    /**
     * Return the list of DS Divisions by division name in any language
     *
     * @param dsDivision the DS Division
     * @return the list of DS Divisions
     */
    public List<DSDivision> getDSDivisionByAnyName(DSDivision dsDivision);

    public Set<DSDivision> getAllDSDivisions();
}